/*
 * ULSF Sagittarius IDA
 * Copyright (C) 2012, John Pritchard, all rights reserved.
 * 
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see
 * <http://www.gnu.org/licenses/>.
 */
package sagittarius.design;

/**
 * {@link Section} operator for the {@link HyperbolicWing} model with
 * span distribution.
 * 
 * @see SectionHyperbolic
 * @see SectionHyperbolicSpheroid
 */
public class SectionHyperbolicWing
    extends SectionHyperbolic
{

    public final ModelHyperbolicSpan model;


    public SectionHyperbolicWing(SearsHaackHyperbolicWing volume, double station, double x, 
                                 double uniform)
    {
        super(volume,station);

        this.model = new ModelHyperbolicSpan(volume,station,x,uniform,this.area);
    }


    public ModelHyperbolicSpan getModel(){
        return this.model;
    }



    public static void main(String[] argv){
        final Body body = new Body();
        final SearsHaackHyperbolicWing volume = new SearsHaackHyperbolicWing(body);

        volume.airfoils(body,60);

        final float station = 25.0f;
        final float longitude = -(((float)(volume.length/2.0))+station);

        final SectionHyperbolicWing section = new SectionHyperbolicWing(volume,station,longitude,volume.uniform(station));
        final float[] vertices = section.getVertices();

        System.out.printf("[V] station % 4.2f, sector % 4.2f, area % 4.2f%n",station,section.getHyperbolicSector(),section.getArea());

        for (int cc = 0, count = vertices.length; cc < count; ){

            System.out.printf("[%d] (% 4.4f,% 4.4f)%n",cc,vertices[cc++],vertices[cc++]);
        }
    }
}
